package pres.moling.common.tool;

/**
 * 实现 Compare 接口的对象比较方法封装
 *
 * @author yh
 * @version 1.0.0
 * 2022/11/29
 **/
public interface CompareHelper {

    /**
     * 小于
     */

    static boolean lt(Comparable x, Comparable y) {
        return x.compareTo(y) < 0;
    }

    /**
     * 小于等于
     */
    static boolean le(Comparable x, Comparable y) {
        return x.compareTo(y) <= 0;
    }

    /**
     * 等于
     */
    static boolean eq(Comparable x, Comparable y) {
        return x.compareTo(y) == 0;
    }

    /**
     * 大于
     */
    static boolean gt(Comparable<Comparable> x, Comparable y) {
        return x.compareTo(y) > 0;
    }

    /**
     * 大于等于
     */
    static boolean ge(Comparable<Comparable> x, Comparable y) {
        return x.compareTo(y) >= 0;
    }


}
